
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.TaskClassPhaseDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class TaskClassPhaseDaoJdbc extends BaseDaoJdbc implements TaskClassPhaseDao {
	String tableName="T_TASK_CLASS_PHASE";
	String beanName="taskClassPhase";
	
	public CommonBean createTaskClassPhase(){
		CommonBean taskClassPhases=this.createBean(tableName,beanName);
                return taskClassPhases;		
	}
	
/*
	public CommonBean findTaskClassPhases(String refid) {
		CommonBean taskClassPhases=this.createTaskClassPhase();
		String sql="select * from T_TASK_CLASS_PHASE where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		taskClassPhases.addData(data);
                return taskClassPhases;
       }
*/
	public CommonBean findTaskClassPhaseById(String id) {
		CommonBean taskClassPhases=this.createTaskClassPhase();
		String sql="select * from T_TASK_CLASS_PHASE where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		taskClassPhases.addData(data);
    return taskClassPhases;
  }
  
	public CommonBean findAllTaskClassPhases() {
		CommonBean taskClassPhases=this.createTaskClassPhase();
		String sql="select * from T_TASK_CLASS_PHASE ";
		List data=this.getCommonDao().select(sql,new String[]{});
		taskClassPhases.addData(data);
    return taskClassPhases;
  }
	public void insertTaskClassPhase(CommonBean taskClassPhaseBean){
		List data=taskClassPhaseBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
}

